<?php
/**
 * Created by PhpStorm.
 * User: wanglei
 * Date: 2016/4/10
 * Time: 23:08
 */
namespace App\Repositories\Admin;
use App\Repositories\AbstractRepository;
use App\Repositories\SingleRepositoryTrait;
use Cache;
use App\Models\Admin\AdminMenusModel;
class IndexRepository extends AbstractRepository{
    use SingleRepositoryTrait;
    public function getMenus()
    {
        $admin_menus = Cache::rememberForever('admin_menus', function() {
            $menus = AdminMenusModel::all()->toArray();
            return getTree($menus);
        });
        return $admin_menus;
    }
}